package com.xukai.springboot.datalayer.statis;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;
import java.util.Map;

/**
 * 数据抓取Mapper
 */
@Mapper
public interface DataCaptureMapper {

    /**
     * 抓取数据
     *
     * @param sql
     * @return
     */
    @SelectProvider(type = DataCaptureMapperProvider.class, method = "GetData")
    public Map<String, Object> GetData(String sql);

    /**
     * 抓取数据
     *
     * @param sql
     * @return
     */
    @SelectProvider(type = DataCaptureMapperProvider.class, method = "GetData")
    public List<Map<String, Object>> GetDataList(String sql);


    /**
     * 数据抓取Mapper代理
     */
    class DataCaptureMapperProvider {

        public String GetData(String sql) {
            return sql;
        }
    }

}
